home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 35
/
PC Gamer IT CD 35 1-2.iso
/
Elink
/
NSCOMM
/
NCJS10.JAR
/
layout.js
< prev
next >
Wrap
Text File
|
1997-10-20
|
2KB
|
75 lines
/*
* layout.js
*
* Copyright (c) 1997 Netscape Communications Corporation, All Rights Reserved
*
* Functions that manage the options->layout preference panel
*/
function fillDefaultList(theForm, category, selector) {
var channelArray = selector.parent.titlebar.document.demo.getData(category);
var curOption;
var channelArrayLength;
var chanPrefsName;
var defaultChannelName = depth.GetNetscapePref("netcaster.defaultChannel", "", false);
var defaultChannelIndex = -1;
if ( null == channelArray ) {
channelArrayLength = 0;
for (i = 0; i < theForm.defaultChannel.length; i++) {
if (i==0) {
theForm.defaultChannel.options[i].text = "(No channels)";
defaultChannelIndex = -1;
} else {
theForm.defaultChannel.options[i] = null;
}
}
} else
channelArrayLength = channelArray.length;
for (i = 0; i < channelArrayLength; i++)
{
chanPrefsName = channelArray[i].getPrefsName();
if ((defaultChannelName != "") && (chanPrefsName == defaultChannelName)) {
defaultChannelIndex = i;
}
curOption = new Option(channelArray[i].getItemName());
curOption.prototype = channelArray[i];
theForm.defaultChannel.options[i] = curOption;
}
if (defaultChannelIndex == -1) {
theForm.onDefault[0].checked = true;
theForm.defaultChannel.selectedIndex = 0;
} else {
theForm.onDefault[1].checked = true;
theForm.defaultChannel.selectedIndex = defaultChannelIndex;
}
}
function loadValues()
{
var drawerDock = depth.GetNetscapePref("netcaster.drawer.dock", "right", false);
if (drawerDock == "left") {
document.layout_form.drawerPos.selectedIndex = 1;
} else {
document.layout_form.drawerPos.selectedIndex = 0;
}
var drawerHide = depth.GetNetscapePref("netcaster.drawer.autoHide", "true", false);
if (drawerHide == "false") {
document.layout_form.autoHide.checked = false;
} else {
document.layout_form.autoHide.checked = true;
}
fillDefaultList(document.layout_form, depth.getDefaultContainer(), opener);
window.layoutLoaded = true;
}
void(0);